<?

	$_SESSION['url'] = getURL();

	

	if(isset($_GET['cid'])){

		$cid = intval($_GET['cid']);

	}else{

		$cid = 0;

	}

	

	if($cid == 0){

		$sql = "SELECT * FROM ".$prefix."tintuc WHERE tt_hienthi = 1";

	}else{

		$sql = "SELECT * FROM ".$prefix."tintuc WHERE tt_loaitintuc = '".$cid."' AND tt_hienthi = 1";

	}

	

	$pp=10; 

	$parr=array();

	$parr=paging($sql,$pp);

	$page=$parr[0];

	$limitvalue=$parr[1];

	$numofpages=$parr[2];

	$sql.=" LIMIT $limitvalue, $pp";

	$rs = $db->query($sql);

	
	$HomeLink = "<a href=\"".$root."/trang-chu/\">Trang chủ</a> ";
	$HomeLink .= "&raquo; Tin tức";
?>



<div id="linkPath">

<div class="linkPath">
		<span style="float: left;"><?=$HomeLink?></span>
 

        <?

			file_exist('includes/inc_thong_tin_rieng.php');

			include('includes/inc_thong_tin_rieng.php');	

		?>
        <div style="clear: both;"></div>
</div>

</div>  

    <!-- Main Page-Content { --> 
    <div id="page-content">            

        <div id="page-content-mpane-all" style="width: 100%;">             

            <div>



                <div style="width: 733px; float: left;">

                    



<div id="news-list">    

    <div class="news-header">     

        <div >

            <div><strong><?=tenChungLoaiTinTuc($cid);?></strong></div>

        </div>                   

      <?
	  	while($row = $db->fetch_array($rs)){

		

			$tt_id = $row[tt_id];

			$tt_tieude = $myString->unQuote(stripslashes($row[tt_tieude]));

			$tt_hinhanh = $PathThumbFile . $row[tt_hinhanh];

			$tt_tomtat = $myString->unQuote(stripslashes($row[tt_tomtat]));

			$tt_noidung = $myString->unQuote(stripslashes($row[tt_noidung]));

			$tt_ngaythang = format_date($row[tt_ngaythang]);

			$tt_solanxem = $row[tt_solanxem];

			$tt_nguoidang = $myString->unQuote(stripslashes($row[tt_nguoidang]));

	  ?>

	                         

                <div>
                    <div>

                        <div>

                            <a href="<?=$root?>/chi-tiet-tin-tuc/<?=$tt_id?>/<?=$cid?>/<?=$myString->vietdecode($tt_tieude)?>" class="product-name"><?=$tt_tieude?></a>  

                        </div>
                        <br style="clear: both;">   
                    </div>                    

                    <div>

                        <p>     

                            <a title="<?=$tt_tieude?>" href="<?=$root?>/chi-tiet-tin-tuc/<?=$tt_id?>/<?=$cid?>/<?=$myString->vietdecode($tt_tieude)?>" class="product-name">                        

                                <img src="<?=$root?>/<?=$tt_hinhanh?>" alt="<?=$tt_tieude?>" align="left" height="100" width="100" onerror="this.src='<?=$root?>/themes/images/noimg.jpg';">                     

                            </a>

								<?=$tt_tomtat?>

                            <br>

                        </p>   

                    </div>       

                    <div style="font-size: 8pt; color: Gray; text-align: right;">

                        Bình luận <?=loadSoTinTucComment($tt_id)?> | Xem: <?=$tt_solanxem?> | Ngày: <?=$tt_ngaythang?>

                    </div>                                       

                </div>                   

       <? } 

	   	if($db->num_rows($rs) == 0){

	   ?>

	   	<p align="center">Chưa có bản tin nào !</p>

		

		<? } ?>

	        

        <div>

         	<!-- PAGING -->

			<p align="right" class="font">

			<?php echo page_div( "".$root."/?mod=tintuc&cid=".$cid."&p=%d_pg", "10", ceil ( $numofpages ), $page ); ?>

			</p>

			<!-- PAGING -->

        </div>

		

        <div style="padding-left: 10px;"></div>

        <br style="font-size: 0pt;">

    </div>  

</div>   

                </div>

                <div>

                    

<!-- Menu Left { -->

	<?

		file_exist('includes/inc_menu_left_tintuc.php');

		include('includes/inc_menu_left_tintuc.php');

	?>

<!-- } Menu Left -->     

                </div>

            </div>

            <div style="clear: both;"></div>

        </div>     

    </div>



    <div style="clear: both;"></div>   

    <br>   

    <!-- } Main Page-Content -->  
            </div>

